use crate::entities::setmeal_dish;

use rust_decimal::Decimal;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SetmealDTO {
    pub id: Option<i64>,                          // 套餐 ID
    pub category_id: Option<i64>,                 // 分类 ID
    pub name: Option<String>,                     // 套餐名称
    pub price: Option<Decimal>,                   // 套餐价格
    pub status: Option<i32>,                      // 状态 0: 停用, 1: 启用
    pub description: Option<String>,              // 描述信息
    pub image: Option<String>,                    // 图片路径
    pub setmeal_dishes: Vec<setmeal_dish::Model>, // 套餐菜品关系
}

impl SetmealDTO {
    pub fn new() -> Self {
        Self {
            id: None,
            category_id: None,
            name: None,
            price: None,
            status: None,
            description: None,
            image: None,
            setmeal_dishes: Vec::new(),
        }
    }
}

#[derive(Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SetMealQueryDTO {
    pub category_id: Option<String>,
    pub name: Option<String>,
    pub page: usize,
    pub page_size: usize,
    pub status: Option<String>,
}

#[derive(Serialize, Deserialize)]
pub struct DeleteSetmealBarnch {
    pub ids: Vec<i64>,
}
